//
//  CategoryEditingViewController.h
//  TimeTracker
//
//  Created by Michael Flakus on 3/2/13.
//  Copyright (c) 2013 Michael Flakus. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <sqlite3.h>

@protocol PropertyEditing
- (void)setValue:(id)newValue forEditedProperty:(NSString *)field;
@end

@interface CategoryEditingViewController : UIViewController {
    id <PropertyEditing> sourceController;
}

@property (nonatomic, retain) IBOutlet UITextField *categoryNameTextField;


/*
 Aspects of the object being edited:
 The object itself, the name of the property being edited, and the name to display to the user.
 */
@property (nonatomic, retain) id editedObject;
@property (nonatomic, retain) NSString *editedPropertyKey;
@property (nonatomic, retain) NSString *editedPropertyDisplayName;


@property (nonatomic, retain) NSString *categoryID;
@property (nonatomic, retain) NSString *categoryName;


// database variables
@property (nonatomic) sqlite3 *database;
@property (strong, nonatomic) NSString *databasePath;


@property (nonatomic, retain) id <PropertyEditing>  sourceController;

- (IBAction)cancel;
- (IBAction)save;

@end
